﻿<BaseControl:DialogControl x:Class="jSLApp.Client.Forms.CommentList"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:BaseControl="clr-namespace:jSLCore.Client.Presentation.BaseControl;assembly=jSLCore.Client.Presentation" xmlns:j="clr-namespace:jSLCore.Client.Presentation.Controls;assembly=jSLCore.Client.Presentation" xmlns:Controls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input" xmlns:sel="clr-namespace:jSLCore.Client.Presentation.Wpf.TelerikSupport.Selection;assembly=jSLCore.Client.Presentation.Telerik" xmlns:col="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView" xmlns:rad="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" xmlns:jBinding="clr-namespace:jSLCore.Client.Presentation.jBinding;assembly=jSLCore.Client.Presentation" xmlns:Security="clr-namespace:jSLApp.Client.Security" mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">
    <j:ImageGroupBox>
        <j:ImageGroupBox.Header>
            <StackPanel Orientation="Horizontal">
                <Button Content="Комментировать" Click="addComment_Clicked">
                    <BaseControl:BaseControl.jBinding>
                        <Security:SecurityBinding/>
                    </BaseControl:BaseControl.jBinding>
                </Button>
            </StackPanel>
        </j:ImageGroupBox.Header>
        <sel:jSLRadGrid x:Name="grid" ShowGroupPanel="False" ShowColumnHeaders="False" RowIndicatorVisibility="Collapsed" IsjValidationBindingAllowed="True">
            <sel:jSLRadGrid.Columns>
                <col:GridViewDataColumn Width="*">
                    <col:GridViewDataColumn.CellTemplate>
                        <DataTemplate>
                            <rad:RadDockPanel LastChildFill="True">
                                <StackPanel Orientation="Horizontal" rad:RadDockPanel.Dock="Top">                                    
                                    <TextBlock Text="{Binding AuthorName}"/>
                                    <TextBlock>
                                        <BaseControl:BaseControl.jBinding>
                                            <jBinding:jBinding Path="CreationDate" ConvertingMode="ToShortDateAndTime"/>
                                        </BaseControl:BaseControl.jBinding>
                                    </TextBlock>
                                    <j:ImageButton Image="../Resources/delete.png" Click="deleteComment_Clicked" ToolTipService.ToolTip="Удалить комментарий">
                                        <BaseControl:BaseControl.jBinding>
                                            <Security:SecurityBinding Permission="DeleteComment"/>
                                        </BaseControl:BaseControl.jBinding>
                                    </j:ImageButton>
                                </StackPanel>
                                <TextBlock TextWrapping="Wrap" Text="{Binding Content}"/>
                            </rad:RadDockPanel>
                        </DataTemplate>
                    </col:GridViewDataColumn.CellTemplate>
                </col:GridViewDataColumn>
            </sel:jSLRadGrid.Columns>
        </sel:jSLRadGrid>
    </j:ImageGroupBox>
</BaseControl:DialogControl>
